<?php

namespace app\api\validate;


use \think\Validate;

/**
 *  经销商商品严重类
 */
class DistributorOrder extends Validate
{
    protected $rule = [
        'ids' => 'require|array',
        'address_id' => 'require|number',
        'shipping_method_id' => 'require|number',
        'tax_package_id' => 'require|number',
        'page' => 'require|number',
        'user_id' => 'require|number',
        'listRows' => 'require|number',
        'brand' => 'require|array',
        'minableCoin' => 'require|array',
        'warehouse' => 'require|array',
        'condition' => 'require|number',
        'sort' => 'require',
        'order_no' => 'require',
        'pickup_name' => 'require',
        'pickup_phone' => 'require',
        'pickup_passport' => 'require'
    ];


    //定义验证提示
    protected $message = [
        'ids.require' => 'distributor.idsRequire',
        'ids.array' => 'distributor.idsArray',

        'address_id.require' => 'distributor.addressIdRequire',
        'address_id.number' => 'distributor.addressIdNumber',
        'shipping_method_id.require' => 'distributor.shippingMethodIdRequire',
        'shipping_method_id.number' => 'distributor.shippingMethodIdNumber',
        'tax_package_id.require' => 'distributor.taxPackageIdRequire',
        'tax_package_id.number' => 'distributor.taxPackageIdNumber',

        'page.require' => 'distributor.pageRequire',
        'page.number' => 'distributor.pageNumber',
        'listRows.require' => 'distributor.listRowsRequire',
        'listRows.number' => 'distributor.listRowsNumber',
        'brand.require' => 'distributor.brandRequire',
        'brand.array' => 'distributor.brandArray',
        'minableCoin.require' => 'distributor.minableCoinRequire',
        'minableCoin.array' => 'distributor.minableCoinArray',
        'warehouse.require' => 'distributor.warehouseRequire',
        'warehouse.array' => 'distributor.warehouseArray',
        'condition.require' => 'distributor.conditionRequire',
        'condition.number' => 'distributor.conditionNumber',
        'sort.require' => 'distributor.sortRequire',
        'order_no.require' => 'distributor.orderNoRequire',
        'pickup_name.require' => 'order.pickupNameRequire',
        'pickup_phone.require' => 'order.pickupPhoneRequire',
        'pickup_passport.require' => 'order.pickupPassportRequire'
    ];

    //定义验证场景
    protected $scene = [
        'list' => ['page','listRows'],
        'assets' => [],
        'checkout' => ['ids'],
        'order' => ['user_id'],
        'create' => ['ids'],
        'orderDetail' => ['order_no']
    ];


}
